<%-- 
    Document   : serveurmonitoring.jsp
    Created on : 30 avr. 2014, 18:21:34
    Author     : smng2095
--%>
<%@page import="java.util.ArrayList"%>
<%@page import="server.Task"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Etat serveur</title>
    </head>
    <body>
        <h1>Etat Système</h1>
	<form action="/Web_Login_IP/dispatcheur" method="GET">
            <button type="submit">Retour</button>
        </form>
	
	
	 <form action="/Web_Login_IP/deconnexion" method="GET">
            <button type="submit">Déconnexion</button>
        </form>
	<%
	    ArrayList<Task> tasks = (ArrayList<Task>)request.getAttribute("tasks");           
          
	     out.print("Serveur : "+ (String)request.getAttribute("ipAddressInt") +" <br />");            
	     out.print("Mémoire libre : " + request.getAttribute("memory") +" <br />");                          
	     out.print("Charge Processeur : "+ request.getAttribute("cpu") +" <br /><br /><br />");
	     out.print("<table>");
	     
	     out.print("<tr><td>Processus</td><td>PID</td><td>User</td></tr>");
	        if(tasks != null)
	     for(int i=0;i<tasks.size();i++)
		out.print("<tr> <td>" + tasks.get(i).getImage()+"</td><td>"+tasks.get(i).getPid()+"</td><td>"+tasks.get(i).getSession()+"</td></tr>");
	     out.print("</table>");
	
	%>
	 
	<form action="/Web_Login_IP/dispatcheur" method="GET">
            <button type="submit">Retour</button>
        </form>
	
	
	 <form action="/Web_Login_IP/dispatcheur" method="GET">
            <button type="submit">Déconnexion</button>
        </form>
	
	
    </body>
</html>
